{% extends 'base.html' %}

{% block main %}
    <h1>我的课程</h1>
    {% if cour_teachs %}

        <table class="table">
            <thead>
            <tr>
                <th scope="col">序号</th>
                <th scope="col">课程名称</th>
                <th scope="col">教材名称</th>
                <th scope="col">教材价格</th>
                <th scope="col">教师</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                {% for cour_teach in cour_teachs %}
                    <tr>
                        <th scope="row">{{ forloop.counter }}</th>
                        <td>
                            <a href="detail/{{ cour_teach.id }}">
                                {{ cour_teach.course }}
                            </a>
                        </td>
                        <td>{{ cour_teach.textbook }}</td>
                        <td>{{ cour_teach.textbook.price }}元</td>
                        <td>{{ cour_teach.teacher.user.username }}</td>
                    </tr>
                {% endfor %}


            <tr>
                <th>教材总价：</th>
                <td style="text-align: center" colspan="3">{{ total_price }}元</td>
                <td></td>

            </tr>
            </tbody>
        </table>

    {% else %}
        <div class="alert alert-danger" role="alert">
            您还未报名任何课程
        </div>
    {% endif %}
{% endblock %}